Skip to content

Comments

Support wild cards in allowed external redirect hosts#7444

Open
labkey-adam wants to merge 7 commits intodevelopfrom
fb_wild_cards
Open

Support wild cards in allowed external redirect hosts#7444
labkey-adam wants to merge 7 commits intodevelopfrom
fb_wild_cards

Conversation

@labkey-adam
Copy link
Contributor

@labkey-adam labkey-adam commented Feb 21, 2026

Rationale

Supporting wild cards in allowed external redirect hosts provides convenience when allowing a large number of subdomains is desired. Also, reconcile redirect for consistency and safety. https://github.com/LabKey/internal-issues/issues/852

// This wild-card pattern matches the host if 1) they have the same number of dots and 2) the host ends with
// the portion of the pattern after the wild card.
int expectedDotCount = StringUtils.countMatches(allowedHost, '.');
ret = (dotCount == expectedDotCount && Strings.CI.endsWith(host, allowedHost.substring(2)));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hmmm, tricky.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants